package com.z.redis.datatype;

/**
 * Redis中的String类型
 */
public class RedisString implements RedisData{
    private volatile long timeout= -1; // volatile确保多线程之间的可见性
    private BytesWrapper value;
    public RedisString(BytesWrapper value) {
        this.value = value;
        this.timeout = -1;
    }
    public RedisString(){
        this.value = null;
    }

    /**
     * get key
     * @return 对应的value
     */
    public BytesWrapper getValue(){
        return value;
    }

    /**
     * set key
     * @param value
     */
    public void setValue(BytesWrapper value){
        this.value = value;
    }
    @Override
    public long getTimeout() {
        return timeout;
    }
    @Override
    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }
}
